///////////////////////////////////////////////////////////
//  GameTimerHighResolution.h
//  Implementation of the Class GameTimerHighResolution
//  Created on:      11-Jan-2015 4:37:12 PM
//  Original author: Eng. Ahmed Yasser
///////////////////////////////////////////////////////////

#if !defined(EA_FA434D16_3FA2_4e12_8E37_C94E8A52CD64__INCLUDED_)
#define EA_FA434D16_3FA2_4e12_8E37_C94E8A52CD64__INCLUDED_

#include <Windows.h>

#include "IGameTimer.h"

namespace EngineGame
{
	namespace EngineUtilities
	{
		/**
		 * Implement the IGameTimer interface using the Hi resolution timer from windows
		 * @author Eng. Ahmed Yasser
		 * @version 1.0
		 * @updated 12-Jan-2015 12:01:54 PM
		 */
		class GameTimerHighResolution : public EngineGame::EngineUtilities::IGameTimer
		{
		private:

			/**
			 * The current time in the clock
			*/
			LARGE_INTEGER _currentTime;

			/**
			 * The clock frequency
			*/
			LARGE_INTEGER _frequency;

			/**
			 * The time of quering time function
			*/
			double _redundentTime;

		public:
			GameTimerHighResolution();
			virtual ~GameTimerHighResolution();
			GameTimerHighResolution(const GameTimerHighResolution& theGameTimerHighResolution);

			/**
			 * Returns the elapsed time from the last time startTimer called
			 */
			virtual double getElapsedTime();
			/**
			 * Initialize the timer with any pre-required operations
			 */
			virtual void initTimer();
			/**
			 * Start the timer of the game
			 */
			virtual void startTimer();

		};

	}

}
#endif // !defined(EA_FA434D16_3FA2_4e12_8E37_C94E8A52CD64__INCLUDED_)
